
const express = require('express');
const app = express();
const router = require('./router/index');
const bodyParser = require('body-parser');
const path = require('path');

// RMVP  // R => '/api'   P => (req,res)=> {}

app.use(bodyParser.urlencoded({ extended: false }));

app.use(bodyParser.json());

app.use(express.static('./public'));

app.engine('art', require('express-art-template'));
app.set('view options', {
    debug: process.env.NODE_ENV !== 'production',
    escape: false
});

app.set('views', path.join(__dirname, './view'));
app.set('view engine', 'art');

app.use('/', router);

app.listen(8080, (err) => {
    console.log('8050~~~~');
});


